aboutsummaryrefslogtreecommitdiff
path: root/src/routes/projects/[projectId]/routine
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2026-09-12 22:22:33 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2026-09-12 22:22:33 +0200
commit1cef356be95a67f95d40f5b0b131f98d11f13c13 (patch)
treea0d93976998b0395e373a7a9f0127cc35e77a6f2 /src/routes/projects/[projectId]/routine
parentb11a40840cfe0e9978f78cacd68d68764eabec58 (diff)
Extract Button primitive, migrate all call sites
Variants primary/accent/ghost/done with scoped styles. Disabled handling unified; block/size/style props cover login stretch, done-lg, save-check positioning. Delete btn-* globals and dead page overrides.
Diffstat (limited to 'src/routes/projects/[projectId]/routine')
-rw-r--r--src/routes/projects/[projectId]/routine/[routineId]/+page.svelte29
1 files changed, 9 insertions, 20 deletions
diff --git a/src/routes/projects/[projectId]/routine/[routineId]/+page.svelte b/src/routes/projects/[projectId]/routine/[routineId]/+page.svelte
index 74880cb..867719a 100644
--- a/src/routes/projects/[projectId]/routine/[routineId]/+page.svelte
+++ b/src/routes/projects/[projectId]/routine/[routineId]/+page.svelte
@@ -3,6 +3,7 @@
import HealthChart from '$lib/components/HealthChart.svelte';
import ScoreBadge from '$lib/components/ScoreBadge.svelte';
import StatusBadge from '$lib/components/StatusBadge.svelte';
+ import Button from '$lib/components/Button.svelte';
import {
formatFrequency,
parseIntervalToDays,
@@ -111,16 +112,15 @@
{#if frequency !== '' && frequencyDays === null}
<p class="error">Intervalle invalide — ex : 1d, 2w, 3m, 1y</p>
{/if}
- <button
- class="btn-primary btn-save"
- type="submit"
+ <Button
disabled={!name.trim() || frequencyDays === null}
+ style="position: relative; padding-right: 2.75rem;"
>
- <span class="btn-save-label">Enregistrer</span>
- <span class="btn-save-check" class:visible={saved} aria-hidden="true"
+ <span>Enregistrer</span>
+ <span class="save-check" class:visible={saved} aria-hidden="true"
>✓</span
>
- </button>
+ </Button>
</form>
{/if}
@@ -170,7 +170,7 @@
placeholder="Note (optionnel)"
autocomplete="off"
/>
- <button class="btn-done btn-done-lg" type="submit">Fait</button>
+ <Button variant="done" size="lg">Fait</Button>
</form>
{/if}
@@ -259,12 +259,6 @@
flex: 1;
}
- .btn-done-lg {
- padding: 0.75rem 1.25rem;
- border-radius: 0.75rem;
- font-size: 0.9375rem;
- }
-
.completion-row {
flex-wrap: wrap;
gap: 0.25rem 0.75rem;
@@ -298,12 +292,7 @@
color: var(--danger);
}
- .btn-save {
- position: relative;
- padding-right: 2.75rem;
- }
-
- .btn-save-check {
+ .save-check {
position: absolute;
right: 1rem;
top: 50%;
@@ -312,7 +301,7 @@
transition: opacity 0.2s ease;
}
- .btn-save-check.visible {
+ .save-check.visible {
opacity: 1;
}
</style>